-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make tests depend on environment variables for classpath jars #1738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make tests depend on environment variables for classpath jars #1738
Conversation
private val dottyLibrary = | ||
new java.io.File("../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar").getPath | ||
new java.io.File(Jars.dottyLib).getPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the whole point of this test and InterfaceEntryPointsTest
is to give an example of how to use the compilers entry points for external projects; so relying on extra files and/or hardcoded path is not great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but do you have an alternative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -15,6 +15,7 @@ object DottyBuild extends Build { | |||
val isNightly = sys.env.get("NIGHTLYBUILD") == Some("yes") | |||
|
|||
val jenkinsMemLimit = List("-Xmx1500m") | |||
val ciLimitedThreads = List("-Ddotty.tests.limitedThreads=2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary if this is the default?
* in `project/Build.scala`. | ||
*/ | ||
def limitResourceFlags = List("-Ytest-pickler") | ||
private val limitedThreads = sys.props.get("dotty.tests.limitedThreads").getOrElse("2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should make sure that limitedThreads
is always less than or equal to partest.threads
|
||
NestUI.echo(s"## we will run ${sequentialTests.length} tests using ${PartestDefaults.numThreads} thread(s)") | ||
val res = super.runTestsForFiles(sequentialTests, kind) | ||
NestUI.echo(s"## we will run ${limitResourceTests.length} tests using ${PartestDefaults.numThreads} thread(s)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message is slightly different from the message below, either add in parallel
here or remove it below
e05afde
to
2f839d2
Compare
sbt adds the correct jars to classpath and the tests depend on `packageAll` which creates these. When using something else however, these together with `sbt-interfaces` do not get propagated from the build. To remedy this and make the testing a bit more flexible, we now take these from `sys.props` instead, see `tests/dotty/Jars.scala`. If the props aren't defined we fall back to the ones default to sbt.
2f839d2
to
ede2d53
Compare
Superseded by #1739 sot that Martin can add his fixes for Eclipse |
sbt adds the correct jars to classpath and the tests depend on
packageAll
which creates these. When using something else, however,these together with
sbt-interfaces
do not get propagated from thebuild.
To remedy this and make the testing a bit more flexible, we now
take these from
sys.props
instead, seetests/dotty/Jars.scala
.If the props aren't defined we fall back to the ones default to sbt.
review by: @odersky